/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jsonHelper;

/**
 *
 * @author andrew
 */
public class SimpleConnection {
    private int idConnection;
    private int startPlanet;
    private int destinationPlanet;
    private int r;
    private int g;
    private int b;

    public SimpleConnection() {
    }

    public int getStartPlanet() {
        return startPlanet;
    }

    public void setStartPlanet(int startPlanet) {
        this.startPlanet = startPlanet;
    }

    public int getIdConnection() {
        return idConnection;
    }

    public void setIdConnection(int idConnection) {
        this.idConnection = idConnection;
    }

    public int getDestinationPlanet() {
        return destinationPlanet;
    }

    public void setDestinationPlanet(int destinationPlanet) {
        this.destinationPlanet = destinationPlanet;
    }

    public int getR() {
        return r;
    }

    public void setR(int r) {
        this.r = r;
    }

    public int getG() {
        return g;
    }

    public void setG(int g) {
        this.g = g;
    }

    public int getB() {
        return b;
    }

    public void setB(int b) {
        this.b = b;
    }
    
    @Override
    public boolean equals(Object o) {
        
        SimpleConnection other = (SimpleConnection)o;
        
        return ((this.destinationPlanet == other.getDestinationPlanet() && this.startPlanet == other.getStartPlanet()) ||
                (this.destinationPlanet == other.getStartPlanet() && this.startPlanet == other.getDestinationPlanet()) );
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 37 * hash + this.startPlanet;
        hash = 37 * hash + this.destinationPlanet;
        return hash;
    }
    
}
